Computing systems—i.e. devices capable of processing electronic data such as computers, telephones, Personal Digital Assistants (PDA), etc.—communicate with other computing systems by exchanging data messages according to a communications protocol that is recognizable by the systems. Such a system utilizes filter engines containing queries that are used to analyze messages that are sent and/or received by the system and to determine if and how the messages will be processed further.
A filter engine may also be called an “inverse query engine.” Unlike a database, wherein an input query is tried against a collection of data records, an inverse query engine tries an input against a collection of queries. Each query includes one or more conditions, or rules, that must be satisfied by an input for the query to evaluate to true against the input.
A collection of queries usually takes the form of one or more filter tables that may contain hundreds or thousands of queries, and each query may contain several conditions. Significant system resources (e.g., setting up query contexts, allocating buffers, maintaining stacks, etc.) are required to process an input against each query in the filter table(s) and, therefore, processing an input against hundreds or thousands of queries can be quite expensive.
Queries included in a particular system may be somewhat similar since the queries are used within the system to handle data in a like manner. As a result, several queries may contain common expressions that currently must be evaluated individually. It would be advantageous to exploit redundant expressions contained in multiple queries to significantly reduce overhead expenses associated with query processing.